<?php defined('IN_IA') or exit('Access Denied');?>

<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<div class='container' style='padding:0 5px 10px;margin:0;width:100%'>

<div class="panel panel-success">
  <div class="panel-heading">常用工具 > 数据列表</div>
  
</div>

	<form id="user_form" class="form-horizontal" method="post">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
				<th style="width:45px;">全选</th>
					<th style="width:50px;">ID</th>			
          			<th style="width:150px;">Openid</th>
          			<th style="width:100px;">昵称</th>
          			<th style="width:100px;">头像</th>
          			<th style="width:100px;">分数</th>
					<th style="min-width:60px;width:70px;">删除</th>
				</tr>
			</thead>
			<tbody>
				<?php  if(is_array($uinfo)) { foreach($uinfo as $item) { ?>
				<td><input type="checkbox" value="<?php  echo $item['id'];?>" name="delete[]"></td>
					<td><?php  echo $item['id'];?></td>
					<td><?php  echo $item['openid'];?></td>
					<td><?php  echo $item['nickname'];?></td>
					<td><img src="<?php  echo $item['headimgurl'];?>" style="width:30px;"></td>
					<td><?php  echo $item['score'];?></td>
					<td>
					
					<a onclick="if(confirm('此操作不可恢复，确认吗？')){location.href='<?php  echo $this->createWebUrl('userinfo', array('id' => $item['id'],'op'=>'del'))?>'}" href="javascript:;" title="删除" class="btn btn-xs btn-danger"><span class="icon icon-close">删除</span></a>
					</td>				
				</tr>
				
				<?php  } } ?>
				<tr >
				<td><input type="checkbox"  onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" name=''>    <input class="btn btn-primary btn-xs" type="submit" value="删除" name="submit" ></td><td></td><td></td><td></td>
				</tr>
			</tbody>
		</table>
		<input type="hidden" value="userinfo" name="do">
		<input type="hidden" value="del" name="op">
		<input type="hidden" name="token" value="<?php  echo $_W['token'];?>" />
	</form>
	<?php  echo $pager;?>
	
	<script>
		$('#user_form').submit(function(){
			if($(":checkbox[name='delete[]']:checked").size() > 0){
				return confirm('删除后不可恢复，您确定删除吗？');
			}
			return false;
		}); 
	</script>
	
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>
